package com.itheima.chouxiang;

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.eat();
        dog.drink();
        Cat cat = new Cat();
        cat.eat();
        cat.drink();

    }
}
 abstract class Animal{
    public abstract void eat();
    public void drink(){
        System.out.println("喝水");
    }
}
class Dog extends Animal{
    @Override
    public void eat() {
        System.out.println("狗吃肉");
    }
}
class Cat extends Animal{
    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }
}